home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PVDRIVER
/
PRWRI12.ZIP
/
PRWRI12X.WCM
< prev
Wrap
Text File
|
1993-07-18
|
4KB
|
181 lines
//////////////////
// PRWRI12X.WCM
// PrintWrite 1.2
//////////////////
// ASSIGN ICON
hicon=loadiconfile("prwri.ico")
if(hicon<>0)holdicon=seticon(hmain,hicon)
// ASK FOR FILENAME
ans=askbox("Enter name of file (no extension)"," ")
if ans+a==a
exit
var1="Write - "
var2=ans
var3=".wri"
file=var1+var2+var3
appactivate(file)
// MAKE SURE ANSWER IS VALID
test=getwindowhandle(file)
if test=0
do
do
ans=askbox("Sorry, that file is not active. Enter name of active Write file (without .wri extension)"," ")
if ans+a==a
exit
var1="Write - "
var2=ans
var3=".wri"
file=var1+var2+var3
appactivate(file)
end
test=getwindowhandle(file)
if test=0
do
msgbox("Sorry, that is an invalid answer. Make sure that Write is running, check filename and try again.","PrintWrite",0)
exit
end
end
// JUMP TO END OF DOCUMENT
delay (100)
sendkeys ("^{end}")
delay (500)
// ASK FOR DOCUMENT LENGTH
pages=askbox("How many pages?"," ")
// MAKE SURE A NUMBER HAS BEEN ENTERED
if pages+a==a
exit
if pages=0
exit
if pages=(" ")
do
pages=askbox("Please enter the number of pages you wish to print."," ")
if pages+a==a
exit
if pages=0
exit
if pages=(" ")
do
msgbox("Sorry, that is an invalid answer. Decide how many pages you want to print and try again.","PrintWrite",0)
exit
end
end
pages=pages-1
// ASK FOR PAGE TO START ON
first=askbox("Start on page","1")
// MAKE SURE A NUMBER HAS BEEN ENTERED
if first+a==a
exit
if first=0
exit
if first=" "
exit
count=first
delay (100)
// PRINT FIRST (SELECTED) PAGE
appactivate(file)
delay (100)
sendkeys ("%f")
delay (100)
sendkeys ("p")
delay (100)
sendkeys ("p")
delay (100)
sendkeys (count)
delay (100)
sendkeys ("{tab}")
delay (100)
sendkeys (count)
delay (1000)
sendkeys ("{enter}")
delay (100)
winact = getappactive()
delay (100)
while (winact = "Write")
do
winact = getappactive()
delay (500)
end
delay (100)
// CHECK NUMBER OF PAGES PRINTED SO FAR
count=first-0
delay (100)
while count<pages
do
delay (100)
count=count+2
delay (100)
// PRINT SECOND (SELECTED) AND SUBSEQUENT PAGES
appactivate(file)
delay (100)
sendkeys ("%f")
delay (100)
sendkeys ("p")
delay (100)
sendkeys ("{tab}")
delay (100)
sendkeys (count)
delay (100)
sendkeys ("{tab}")
delay (100)
sendkeys (count)
delay (1000)
sendkeys ("{enter}")
delay (100)
winact = getappactive()
delay (100)
while (winact = "Write")
do
winact = getappactive()
delay (500)
end
end
delay (100)
// PROMPT FOR READINESS TO PRINT ALTERNATE PAGES
reply=msgbox("Ready to continue print job?","Pause",1)
if reply=2
exit
if reply=1
// CHECK NUMBER OF PAGES PRINTED SO FAR
count=first-1
delay (100)
while count<pages
do
count=count+2
delay (100)
// PRINT ALTERNATE PAGES
delay (100)
appactivate(file)
delay (100)
sendkeys ("%f")
delay (100)
sendkeys ("p")
delay (100)
sendkeys ("{tab}")
delay (100)
sendkeys (count)
delay (100)
sendkeys ("{tab}")
delay (100)
sendkeys (count)
delay (1000)
sendkeys ("{enter}")
delay (100)
winact = getappactive()
delay (100)
while (winact = "Write")
do
winact = getappactive()
delay (500)
end
end
delay (100)
// GOODBYE
msgbox("Thank you for using WinCmd and PrintWrite!","PrintWrite",0)
delay (100)
appactivate(file)
delay (100)
sendkeys ("^{home}")
delay (100)
exit